CXXFLAGS	      = -I/usr/include/X11R5

DEST	      = .

EXTHDRS	      =

HDRS	      = patchlevel.h

INSTALL	      = /etc/install

LD	      = $(CXX)

LDFLAGS	      = -L/usr/lib/X11R5

LIBS	      = -lX11

MAKEFILE      = Makefile

OBJS	      = xmemory.o

PRINT	      = pr

PROGRAM       = xmemory

SHELL	      = /bin/sh

SRCS	      = xmemory.C

SYSHDRS	      = /usr/include/.unsupp/sys/_errno.h \
		/usr/include/errno.h \
		/usr/include/pwd.h \
		/usr/include/stdio.h \
		/usr/include/stdlib.h \
		/usr/include/string.h \
		/usr/include/strings.h \
		/usr/include/sys/errno.h \
		/usr/include/sys/stdsyms.h \
		/usr/include/sys/time.h

all:		$(PROGRAM)

$(PROGRAM):     $(OBJS)
		@echo "Linking $(PROGRAM) ..."
		$(LD) $(LDFLAGS) $(OBJS) $(LIBS) -o $(PROGRAM)
		@echo "done"

clean:;		@rm -f $(OBJS) core

clobber:;	@rm -f $(OBJS) $(PROGRAM) core tags

depend:;	@mkmf -f $(MAKEFILE) ROOT=$(ROOT)

echo:;		@echo $(HDRS) $(SRCS)

index:;		@ctags -wx $(HDRS) $(SRCS)

install:	$(PROGRAM)
		@echo Installing $(PROGRAM) in $(DEST)
		@-strip $(PROGRAM)
		@if [ $(DEST) != . ]; then \
		(rm -f $(DEST)/$(PROGRAM); $(INSTALL) -f $(DEST) $(PROGRAM)); fi

print:;		@$(PRINT) $(HDRS) $(SRCS)

tags:           $(HDRS) $(SRCS); @ctags $(HDRS) $(SRCS)

update:		$(DEST)/$(PROGRAM)

$(DEST)/$(PROGRAM): $(SRCS) $(LIBS) $(HDRS) $(EXTHDRS)
		@$(MAKE) -f $(MAKEFILE) ROOT=$(ROOT) DEST=$(DEST) install
###
xmemory.o: /usr/include/stdio.h /usr/include/sys/stdsyms.h \
	/usr/include/stdlib.h /usr/include/pwd.h /usr/include/errno.h \
	/usr/include/sys/errno.h /usr/include/.unsupp/sys/_errno.h \
	/usr/include/strings.h /usr/include/string.h /usr/include/sys/time.h
